classdef Instrument < handle
    
    properties(Access = protected)
        conn
    end
    
    properties
        GPIB_address;
        GPIB_controller;
        address;
    end
    
    methods
        function this = Instrument(GPIB_controller, GPIB_address, address)
            this.address = address;
            this.GPIB_address = GPIB_address;
            this.GPIB_controller = GPIB_controller;
            this.conn = gpib(this.GPIB_controller,this.GPIB_address,this.address);
            this.conn.InputBufferSize = 2e7;
            this.conn.Timeout = 60;
            %resetting the device
            
        end
        
        function writeCmd(this, cmd)
            fprintf(this.conn,cmd);
        end
        
        function result = readCmd(this)
            result = fscanf(this.conn);
        end
        
        
        
    end
    
end